<template>
  <div id="app">
    <h2>App</h2>
    <!-- 
      Vue2中要绑定原生事件, 需要使用.native, 且事件名是DOM事件名
      事件绑定在子组件的根标签
     -->
    <Child @click.native="fn2" @test="fn"/>
  </div>
</template>

<script>
import Child from './Child.vue'

export default {
  name: 'App',
  components: {
    Child
  },

  methods: {
    fn (e) {
      console.log('fn()', e)
    },

    fn2 (e) {
      console.log(e.target)
    }
  }
}
</script>

